package com.tdkj.exception;

/**
 * 
 * 
 * FileName: SystemException.java
 * 
 * @Description: TODO异常处理
 * 
 *               All rights Reserved, Designed By ZTE-ITS
 * 
 *               Copyright: Copyright(C) 2010-2011
 * 
 *               Company 天成科技有限公司
 * 
 * @author: 李兴建
 * 
 * @version V1.0
 * 
 *          Createdate: 2012-8-21 下午08:48:23
 * 
 * 
 * 
 *          Modification History:
 * 
 *          Date Author Version Discription
 * 
 *          
 *          ----------------------------------------------------------------------
 *          -------------
 * 
 *          2012-8-21 李兴建 1.0 1.0
 * 
 *          Why & What is modified: <修改原因描述>
 */
public class SystemException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public SystemException(String frdMessage) {

		super(createFriendlyErrMsg(frdMessage));

	}

	public SystemException(Throwable throwable) {

		super(throwable);

	}

	public SystemException(Throwable throwable, String frdMessage) {

		super(throwable);

	}

	/**
	 * 
	 * 创建友好的报错信息
	 * 
	 * */

	private static String createFriendlyErrMsg(String msgBody) {

		String prefixStr = "抱歉。";

		String suffixStr = "请稍后再试或与管理员联系！";

		StringBuffer friendlyErrMsg = new StringBuffer();

		friendlyErrMsg.append(prefixStr);

		friendlyErrMsg.append(msgBody);

		friendlyErrMsg.append(suffixStr);

		return friendlyErrMsg.toString();

	}

}